BrowserViewState

@Stable()
public final class BrowserViewState implements AutoCloseable

State of BrowserView.

This state serves as a bridge between the browser instance and the BrowserView. It reflects the internal state of the browser in a way that is understandable by both the view and Compose. Asynchronous updates from the browser are converted to a Compose-observable state and vice versa. Additionally, it allocates and manages the internal resources necessary for the view to work.

A browser instance can only be associated with one state instance at a time. An attempt to create several states for a single browser leads to a runtime exception.

BrowserViewState.close should be called to release all allocated memory and resources when the state is no longer needed.

Please note, as for now, the state supports only OFF_SCREEN rendering mode. Passing a browser instance with HARDWARE_ACCELERATED mode leads to a runtime exception. See also: Rendering modes.

Since

8.0.0

Parameters

browser

The browser, whose content is to be displayed.

scope

The coroutine scope used for updating Compose observables.

window

The native AWT window in which the browser view is rendered.

Constructors

Link copied to clipboard
public BrowserViewState BrowserViewState(Browser browser, CoroutineScope scope, Window window)

Properties

Link copied to clipboard

The configuration options for the drag-and-drop functionality.

Functions

Link copied to clipboard
public Unit close()

Closes the browser state and releases the occupied resources.

Link copied to clipboard

The configuration options for the drag-and-drop functionality.

Link copied to clipboard
public final Unit setDragAndDropOptions(DragAndDropOptions dragAndDropOptions)

The configuration options for the drag-and-drop functionality.